﻿using mscook.core.domain;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHibernate.Linq;

namespace mscook.core.repositories
{
    public class LoginUserOfPresentRepository:Repository<LoginUserOfPresent>, mscook.core.repositories.ILoginUserOfPresentRepository
    {
        public IList<LoginUserOfPresent> SelectLimitByOrder(int start, int limit, out long total)
        {
            var q = (from x in this.Session.Query<LoginUserOfPresent>() select x)
                .Where(o => o.IsDelete == false).OrderBy(o => o.IsPassed).OrderByDescending(o => o.CreateTime);
            total = q.Count();
            return q.Skip(start).Take(limit).ToList();
        }
    }
}
